<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
	<f:facet name="first">
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="viewport"
			content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="description" content="Feedback online" />
		<meta name="author" content="Hien" />
		<link rel="shortcut icon" type="image/png"
			href="#{request.contextPath}/resources/main/images/favicon.ico" />
	</f:facet>
	<title>Feedback Teacher</title>
	<h:outputScript library="primefaces" name="jquery/jquery.js"
		target="head" />
	<h:outputScript library="primefaces" name="jquery/jquery-plugins.js"
		target="head" />
	<h:outputStylesheet library="webjars"
		name="bootstrap/3.3.4/css/bootstrap.min.css"></h:outputStylesheet>
	<h:outputStylesheet library="webjars"
		name="bootstrap/3.3.4/css/bootstrap-jsf.css"></h:outputStylesheet>
	<h:outputStylesheet library="webjars"
		name="font-awesome/4.3.0/css/font-awesome-jsf.css" />
	<h:outputStylesheet library="webjars"
		name="ionicons/2.0.1/css/ionicons.min.css"></h:outputStylesheet>
	<h:outputStylesheet name="/main/css/student.css"></h:outputStylesheet>
</h:head>
<body>
	<h:form>
		<h:form>
			<p:panel id="btlg" visible="#{!loginTeacherBean.teacherIsLogin}">
				<h:commandButton value="Login" type="button"
					styleClass="btn btn-lg btn-success btn-block"
					onclick="PF('dlg1').show();" />
			</p:panel>

			<p:dialog header="Login" widgetVar="dlg1" id="dialog">
				<h:form id="formlogin">
					<p:panel id="panellogin"
						visible="#{!loginTeacherBean.teacherIsLogin}">
						<p:outputLabel for="username" value="User: "></p:outputLabel>
						<h:inputText value="#{loginTeacherBean.username}" id="username"
							styleClass="form-control" pt:placeholder="xxxxxxx"
							required="true" />
						<p:outputLabel for="password" value="Password: "></p:outputLabel>
						<h:inputSecret value="#{loginTeacherBean.password}" id="password"
							styleClass="form-control" pt:placeholder="eg. X8df!90EO"
							required="true" />
						<h:commandButton id="loginb" value="Login"
							styleClass="btn btn-lg btn-success btn-block"
							action="#{loginTeacherBean.loginTeacher}">
							<!-- khoong them f:ajax o day -->
						</h:commandButton>
					</p:panel>
				</h:form>
			</p:dialog>
			<p:panel id="panellogout"
				visible="#{loginTeacherBean.teacherIsLogin}">
				<h:outputText value="#{loginTeacherBean.teacher.teacherName}  " />
				<h:commandButton id="logout" value="Logout"
					styleClass="btn btn-lg btn-success btn-block"
					action="#{loginTeacherBean.logoutTeacher}">
					<p:ajax update="panellogout dialog btlg ">
					</p:ajax>
				</h:commandButton>
			</p:panel>
		</h:form>

		<p:panel visible="#{loginTeacherBean.teacherIsLogin}">
			<p:panel header="Thông tin giảng viên">
				<p:row colspan="7">
					<h:outputText value="Tên: " />
					<h:outputText value="#{loginTeacherBean.teacher.teacherName}   " />
					<h:outputText value="Mã số: " />
					<h:outputText value="#{loginTeacherBean.teacher.teacherNo}" />
				</p:row>
			</p:panel>
			<h:form id="form-view">
				<p:panel header="Biểu đồ thể hiện tỉ lệ kết quả đánh giá" id="chart">
					<p:chart type="pie" model="#{chartBean.pieModel1}"
						style="width:400px;height:300px" />
				</p:panel>
				<p:panel id="table">
					<p:dataTable value="#{teacherBean.listFeedbackT}" var="list"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {Exporters}"
						paginator="true" rows="10" style="margin-bottom:20px" id="tbl">
						<f:facet name="{Exporters}">
							<h:commandLink>
								<p:graphicImage name="#{request.contextPath}/resources/main/images/student/excel.png" width="24" />
								<p:dataExporter type="xls" target="tbl" fileName="ketqua" />
							</h:commandLink>
							<h:commandLink>
								<p:graphicImage name="#{request.contextPath}/resources/main/images/student/pdf.png" width="24" />
								<p:dataExporter type="pdf" target="tbl" fileName="ketqua" />
							</h:commandLink>
							<h:commandLink>
								<p:graphicImage name="#{request.contextPath}/resources/main/images/student/xml.png" width="24" />
								<p:dataExporter type="xml" target="tbl" fileName="ketqua" />
							</h:commandLink>
						</f:facet>
						<p:column headerText="Tiêu Chí" width="5%">
							<h:outputText value="#{list.question.questionID}" />
						</p:column>
						<p:column headerText="Nội Dung" width="50%">
							<h:outputText value="#{list.question.questionTitle}" />
						</p:column>
						<p:column headerText="Mức Độ Hài Lòng" width="38%">
							<p:row>
								<h:outputText value="5: #{teacherBean.percent5}% - " />
								<h:outputText value="4: #{teacherBean.percent4}% - " />
								<h:outputText value="3: #{teacherBean.percent3}% - " />
								<h:outputText value="2: #{teacherBean.percent2}% - " />
								<h:outputText value="1: #{teacherBean.percent1}%" />
							</p:row>
						</p:column>
						<p:column headerText="Tổng Kết" width="7%">
							<h:outputText value="95,32%" />
						</p:column>
					</p:dataTable>
				</p:panel>
			</h:form>
		</p:panel>
	</h:form>
	<!-- footer -->
	<h4 style="color: green;">Hệ thống quản lý ý kiến đánh giá</h4>
	<h4 style="color: olive;">Giáo viên hướng dẫn: LÊ PHI HÙNG</h4>
	<h5 style="color: blue;">
		Thành viên: <br />Nguyễn Minh Nhật 10130053 <br /> Nguyễn Hửu Hiền
		10130021
	</h5>
</body>
</html>
